package org.ihelpuoo.weboo.action.http.db;

import org.ihelpuoo.orm.filter.FieldFilter;
import org.ihelpuoo.weboo.action.http.AjaxAction;
import org.ihelpuoo.weboo.module.ActionContext;

public class FetchAction extends AjaxAction
{

	@Override
	protected Object doAjax(ActionContext context) throws Exception
	{
		FieldFilter in_a = context.properties().getDBIOActivedFieldFilter();
		FieldFilter in_k = context.properties().getDBIOLockedFieldFilter();
		FieldFilter ou_a = context.properties().getPrintActivedFieldFilter();
		FieldFilter ou_k = context.properties().getPrintLockedFieldFilter();
		
		Object obj = context.getFormObject();
		return context.pojo().fetch(obj,(in_a == null ? ou_a : in_a),(in_k == null ? ou_k : in_k));
	}

}
